﻿<Page x:Class="NewMarkersSample.Pages.XmlChartPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	  xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
	  xmlns:local="clr-namespace:NewMarkersSample.Pages"
    Title="XmlChartPage">

	<Page.Resources>
		<XmlDataProvider x:Key="sampleDataSource" Source="xml.xml" />
		<local:XmlTextToDoubleConverter x:Key="converter"/>
	</Page.Resources>

	<Grid DataContext="{StaticResource sampleDataSource}">
		<d3:ChartPlotter x:Name="plotter" Visible="-0.6,-100,15,4100" Margin="30" SnapsToDevicePixels="True">
			<d3:MarkerChart x:Name="chart" ItemsSource="{Binding XPath=/Stats/dataDist/DataCounts}">
				<d3:TemplateMarkerGenerator>
					<DataTemplate>
						<Rectangle Fill="Red" d3:ViewportPanel.ViewportWidth="0.8" d3:ViewportPanel.ViewportHeight="{Binding}"
								   d3:ViewportPanel.Y="0" d3:ViewportPanel.ViewportVerticalAlignment="Bottom" 
								   d3:ViewportPanel.X="{d3:SelfBinding Path=(d3:MarkerChart.Index)}"/>
					</DataTemplate>
				</d3:TemplateMarkerGenerator>
			</d3:MarkerChart>
		</d3:ChartPlotter>
	</Grid>
</Page>
